package com.xiaoyu.tool.response.user;

import com.xiaoyu.tool.entity.User.User;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.persistence.Column;

/**
 * @author xiaoyu on 2018/08/09
 */
@Data
public class UserResponse {

    private Long id;

    @Column
    private String nickName;

    @Column
    private String unionId;

    @Column
    private String openId;

    @Column
    private String appletOpenId;

    @Column
    private String country;

    @Column
    private String province;

    @Column
    private String city;

    @Column
    private String headImgUrl;

    @Column
    private String language;

    @Column
    private Integer sex;

    public static UserResponse userTransformUserResponse(User user){
        UserResponse userResponse = new UserResponse();
        BeanUtils.copyProperties(user,userResponse);
        return userResponse;
    }


}
